package com.duan.laugh.event.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.duan.laugh.event.ValidGroup.ValidGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 事件模型
 * </p>
 *
 * @author liutf
 * @since 2019-11-12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("event_model")
@ApiModel(value = "EventModel对象", description = "事件模型")
public class EventModel implements Serializable {

    private static final long serialVersionUID = 1L;
    public static final String NOLMAL = "不能为空";

    @ApiModelProperty(value = "id")
    @NotNull(groups = {ValidGroup.Update.class}, message = "事件模型id" + NOLMAL)
    @Null(groups = {ValidGroup.Add.class}, message = "事件模型id必须为空")
    private Long id;

    @ApiModelProperty(value = "事件模型类型（2数据类、3业务类、4行为类）")
    @NotNull(message = "事件模型类型" + NOLMAL)
    private Integer type;

    @ApiModelProperty(value = "事件模型名称")
    @NotBlank(message = "事件模型名称" + NOLMAL)
    private String name;

    @ApiModelProperty(value = "事件模型状态（0启用、1禁用）")
    private Integer status;

    @ApiModelProperty(value = "业务类型（16人员 员工入职 ... 19社保 社保增员）")
    @NotNull(message = "业务类型" + NOLMAL)
    private Integer businessType;

    @ApiModelProperty(value = "url")
    private String url;

    @ApiModelProperty(value = "method")
    private String method;

    @ApiModelProperty(value = "租户id")
    private Long tenantId;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    private LocalDateTime updateTime;

    @ApiModelProperty("逻辑删除标识 0未删除1删除")
    @TableLogic
    private Integer delFlag = 0;
}
